Attribute VB_Name = "modODBCElectrosonic"
'---------------------------------------------------------------------------------------
'Module     : modODBC
'Author     : Joseph Weir
'Purpose    : Electrosonic.
'---------------------------------------------------------------------------------------
Option Explicit
'

#If Electrosonic Then

Dim m_strKeyValue As String
Dim m_blnProcessing As Boolean
Dim mstrIntegrationStyle As String
Dim mstrEXPORT_FILE_PATH As String
Dim mstrIMPORT_FILE_PATH As String
'


Public Function ClearCommodity() As Boolean

End Function
'

Public Function ClearShipScreen() As Boolean

    On Error Resume Next
    frmShip.f38 = g_clsReg.GetRegistryValue("Carry_f38", "")
    frmShip.f75 = g_clsReg.GetRegistryValue("Carry_f75", "")
    
End Function
'

'---------------------------------------------------------------------------------------
' Procedure : Connect()
' DateTime  : 7/5/2004
' Purpose   : Open connection to ODBC test DSN. Instantiate module level recordset.
'---------------------------------------------------------------------------------------
'
Private Function Connect() As Boolean
    On Local Error GoTo Handler

    Connect = True

    Exit Function

Handler:
    MsgBox Err.Description, , "modODBC.Connect"

End Function
'

'---------------------------------------------------------------------------------------
' Procedure : GetData()
' DateTime  : 7/5/2004
' Purpose   : REQUIRED SUB. Called from frmShip.f1_LostFocus, which is the OrderID field.
'             Call routines needed to get data from the customer's system and assign the
'             value to the appropriate fields on the Ship form. This example uses ODBC.
'---------------------------------------------------------------------------------------
'
Public Function GetData(ByVal strKey As String) As Boolean

    On Local Error GoTo Handler

    Dim i As Long
    Dim intRecordCurrent As Long
    Dim strEmail As String
    Dim strZip As String
    Dim strRecords() As String

    m_strKeyValue = strKey

    mstrIMPORT_FILE_PATH = g_clsSettings.Setting("IntegrationFolder")
    If mstrIMPORT_FILE_PATH = "" Then
        If GetSystemName = "CAN00283812" Then
            g_clsSettings.Setting("IntegrationFolder") = "C:\Documents and Settings\271425\My Documents\CUSTOMERDATA\CUSTOMERDATA\ElectroSonic\"
        ElseIf GetSystemName = "WINXPC9CA96EA3" Then
            g_clsSettings.Setting("IntegrationFolder") = "C:\Documents and Settings\563774\My Documents\FXI\Projects\Meena\ELECTROSONIC\"
        Else
            g_clsSettings.Setting("IntegrationFolder") = "Z:\OUTBOUND\"
        End If
        g_clsSettings.SaveSettings
        mstrIMPORT_FILE_PATH = g_clsSettings.Setting("IntegrationFolder")
        frmMsgBox.ShowMessage "Configuration file (FSMSClient.xml) updated with IntegrationFolder.", 8000
    End If

'    If g_clsReg.GetRegistryValue("IntegrationLevel", "Writeback") <> "Writeback" _
'    And g_clsReg.GetRegistryValue("IntegrationLevel", "Writeback") <> "Order Lookup" Then
'        GetData = True
'        Exit Function
'    End If

    Call DeleteIntlCommodities(strKey)

    strRecords = RecordImport(mstrIMPORT_FILE_PATH, strKey & ".txt")

    With frmShip
        .f23.Text = ImportConvert("MiscellaneousPaymentType", strRecords(11, intRecordCurrent))
        .f3056.Text = strRecords(10, intRecordCurrent)
        '
        .f20.Text = strRecords(12, intRecordCurrent)
        .f13.Text = strRecords(3, intRecordCurrent)
        .f14.Text = strRecords(4, intRecordCurrent)
        .f15.Text = strRecords(5, intRecordCurrent)
        .f11.Text = strRecords(2, intRecordCurrent)
        .f12.Text = strRecords(1, intRecordCurrent)
        .f50.Text = strRecords(8, intRecordCurrent)
        .f18.Text = strRecords(9, intRecordCurrent)
        .f16.Text = strRecords(6, intRecordCurrent)
        .f17.Text = strRecords(7, intRecordCurrent)
        strZip = Left(.f17.Text, 3)

        Select Case mstrIntegrationStyle
        Case "GROUND"
            .f1274.Text = GetDataServiceType(strZip)
        Case "FREIGHT"
            .f1274.Text = "111"
        Case "EXPRESSPROCESS"
            .f1274.Text = "01"
            .f1670.SetFocus
        Case "DG"
            .f1274.Text = "01"
            frmDG.Show vbModeless, frmShip
        Case Else
            .f1274.Text = "01"
        End Select

        .f1273.Text = "01"
        .f25.Text = strRecords(0, intRecordCurrent)

    End With


    If mstrIntegrationStyle = "EXPRESSPROCESS" Then
        For i = 1 To 500
            DoEvents
        Next i
        If IsNumeric(frmShip.f1670.Text) Then
            If Val(frmShip.f1670.Text) > 0 Then
                Call frmShip.ShipButton
            Else
                frmMsgBox.ShowMessage "Weight is expected to be on the scale.", 4000
            End If
        Else
            frmMsgBox.ShowMessage "Weight is expected to be on the scale.", 4000
        End If
        
        frmShip.f1670.SetFocus
        
    Else
        If frmShip.f116.Enabled Then frmShip.f116.SetFocus
    End If

    GetData = True
Release:
    ' call kill
    Exit Function
Handler:
    MsgBox Err.Description, , "modODBC.GetData"
    ' Call Kill
    Resume Release

End Function
'

Private Function GetDataServiceType(strZip As String) As String

    Select Case True
    'QUEBEC
        Case strZip >= "G0M" And strZip <= "G0S"
            GetDataServiceType = "01"
        Case strZip >= "G1A" And strZip <= "G3A"
            GetDataServiceType = "01"
        Case strZip >= "G5V" And strZip <= "G9Z"
            GetDataServiceType = "01"
        Case strZip >= "G8T" And strZip <= "G9Z"
            GetDataServiceType = "01"
        Case strZip >= "H0A" And strZip <= "H9Z"
            GetDataServiceType = "01"
        Case strZip = "J0P"
            GetDataServiceType = "01"
        Case strZip >= "J1A" And strZip <= "J3E"
            GetDataServiceType = "01"
        Case strZip >= "J3T" And strZip <= "J3V"
            GetDataServiceType = "01"
        Case strZip >= "J3Y" And strZip <= "J5R"
            GetDataServiceType = "01"
        Case strZip >= "J5Y" And strZip <= "J7W"
            GetDataServiceType = "01"
        Case strZip >= "J8X" And strZip <= "J9A"
            GetDataServiceType = "01"
        Case strZip >= "J9B" And strZip <= "J9G"
            GetDataServiceType = "01"
        Case strZip >= "J9H" And strZip <= "J9J"
            GetDataServiceType = "01"
    'ONTARIO
        Case strZip >= "K1A" And strZip <= "K4B"
            GetDataServiceType = "01"
        Case strZip >= "K6H" And strZip <= "K6Z"
            GetDataServiceType = "01"
        Case strZip = "K7G"
            GetDataServiceType = "01"
        Case strZip >= "K7K" And strZip <= "K7R"
            GetDataServiceType = "01"
        Case strZip >= "K8N" And strZip <= "K8V"
            GetDataServiceType = "01"
        Case strZip >= "K9A" And strZip <= "K9V"
            GetDataServiceType = "01"
        Case strZip >= "L1A" And strZip <= "L1E"
            GetDataServiceType = "01"
        Case strZip >= "L1G" And strZip <= "L1Z"
            GetDataServiceType = "01"
        Case strZip >= "L2A" And strZip <= "L3M"
            GetDataServiceType = "01"
        Case strZip >= "L3P" And strZip <= "L3T"
            GetDataServiceType = "01"
        Case strZip >= "L3V" And strZip <= "L3W"
            GetDataServiceType = "01"
        Case strZip >= "L3X" And strZip <= "L4L"
            GetDataServiceType = "01"
        Case strZip >= "L4M" And strZip <= "L4N"
            GetDataServiceType = "01"
        Case strZip = "L4R"
            GetDataServiceType = "01"
        Case strZip >= "L4S" And strZip <= "L7B"
            GetDataServiceType = "01"
        Case strZip = "L7C"
            GetDataServiceType = "01"
        Case strZip >= "L7E" And strZip <= "L9K"
            GetDataServiceType = "01"
        Case strZip >= "L9L" And strZip <= "L9S"
            GetDataServiceType = "01"
        Case strZip = "L9T"
            GetDataServiceType = "01"
        Case strZip >= "L9U" And strZip <= "L9X"
            GetDataServiceType = "01"
        Case strZip >= "L9Y" And strZip <= "L9Z"
            GetDataServiceType = "01"
        Case strZip >= "M0A" And strZip <= "M9Z"
            GetDataServiceType = "01"
        Case strZip >= "N0A" And strZip <= "N0B"
            GetDataServiceType = "01"
        Case strZip >= "N0K" And strZip <= "N0M"
            GetDataServiceType = "01"
        Case strZip = "N0R"
            GetDataServiceType = "01"
        Case strZip >= "N1A" And strZip <= "N1B"
            GetDataServiceType = "01"
        Case strZip >= "N1C" And strZip <= "N2Y"
            GetDataServiceType = "01"
        Case strZip = "N2Z"
            GetDataServiceType = "01"
        Case strZip >= "N3A" And strZip <= "N3V"
            GetDataServiceType = "01"
        Case strZip >= "N3W" And strZip <= "N9Z"
            GetDataServiceType = "01"
    'NWT and Yukon
        Case strZip >= "X0A" And strZip <= "Y9Z"
            GetDataServiceType = "01"
        Case strZip = "G4T"
            GetDataServiceType = "01"
        Case strZip = "G0G"
            GetDataServiceType = "01"
        Case strZip = "R0B"
            GetDataServiceType = "01"
         Case strZip = "A2V"
            GetDataServiceType = "01"
        Case strZip >= "A0P" And strZip <= "A0Z"
            GetDataServiceType = "01"
        Case strZip >= "A0A" And strZip <= "A0O"
            GetDataServiceType = "01"
        Case strZip >= "A10" And strZip <= "A2U"
            GetDataServiceType = "01"
        Case strZip >= "A2W" And strZip <= "A9Z"
            GetDataServiceType = "01"
        Case Else
            GetDataServiceType = "92"
    End Select

End Function
'

'---------------------------------------------------------------------------------------
' Procedure : GetPickupData()
' DateTime  : 1/30/2006
' Purpose   : REQUIRED SUB. Called from frmAddTags.f1_LostFocus, which is the OrderID field.
'             Call routines needed to get data from the customer's system and assign the
'             value to the appropriate fields on the Ship form. This example uses ODBC.
'---------------------------------------------------------------------------------------
'
Public Function GetPickupData(ByVal strKey As String) As Boolean


    GetPickupData = True

End Function
'---------------------------------------------------------------------------------------
' Procedure : WriteReply()
' DateTime  : 2/14/2005
' Purpose   : REQUIRED SUB. Called after a successful ship transaction.
'             This example shows how to obtain multiple occurrence fields from the
'             FXRS reply and how to obtain multiple occurrence fields included in the
'             input transaction but not returned in the FXRS reply.
'---------------------------------------------------------------------------------------
'
Public Sub WriteReply()

    On Error GoTo Cafe_AfterShipment_Error

    Dim objFSO As FileSystemObject
    Dim strMiscellaneousPaymentType As String
    Dim strRecord As String
    Dim strFilename As String

    Set objFSO = New FileSystemObject

    mstrEXPORT_FILE_PATH = g_clsSettings.Setting("ExportFolder")
    If mstrEXPORT_FILE_PATH = "" Then
        If GetSystemName = "CAN00283812" Then
            g_clsSettings.Setting("ExportFolder") = "C:\Documents and Settings\271425\My Documents\CUSTOMERDATA\CUSTOMERDATA\ElectroSonic\"
        ElseIf GetSystemName = "WINXPC9CA96EA3" Then
            g_clsSettings.Setting("ExportFolder") = "C:\Documents and Settings\563774\My Documents\FXI\Projects\Meena\ELECTROSONIC\"
        Else
            g_clsSettings.Setting("ExportFolder") = "Z:\OUTBOUND\"
        End If
        g_clsSettings.SaveSettings
        mstrEXPORT_FILE_PATH = g_clsSettings.Setting("ExportFolder")
        frmMsgBox.ShowMessage "Configuration file (FSMSClient.xml) updated with ExportFolder.", 8000
    End If

    If m_strKeyValue <> "" Then
        If Not m_blnProcessing Then
            If objFSO.FileExists(mstrIMPORT_FILE_PATH & m_strKeyValue & ".txt") Then
                objFSO.DeleteFile (mstrIMPORT_FILE_PATH & m_strKeyValue & ".txt")
            End If
        End If
    End If

    ' Append record to file
    If m_strKeyValue <> "" Then
        strFilename = m_strKeyValue
    ElseIf g_str25 <> "" Then
        strFilename = g_str25
    Else
        frmMsgBox.ShowMessage "Reference is blank.  After shipment data is not written.", 8000
        Exit Sub
    End If
    Select Case g_str23
        Case "1"
            strMiscellaneousPaymentType = "FEDEX P1"
        Case "2"
            strMiscellaneousPaymentType = "FEDEX COLL"
        Case Else
            strMiscellaneousPaymentType = "FEDEX"
    End Select

    strRecord = String$(337, " ")

    Mid(strRecord, 1, 16) = Left$(g_str25, 16)
    Mid(strRecord, 17, 10) = Right("0000000000" & g_str37, 10)
    Mid(strRecord, 27, 20) = Left$(g_str3056, 20)
    Mid(strRecord, 47, 9) = Left$(frmShip.cboCustID.Text, 9)
    Mid(strRecord, 56, 30) = Left$(g_str11, 30)
    Mid(strRecord, 86, 30) = Left$(g_str13, 30)
    Mid(strRecord, 116, 30) = Left$(g_str14, 30)
    ' customer is expecting Address Line 3 in a fixed length file. program is writing back postal code
    ' 2008-07-09, JFW, Correction
    'Mid(strRecord, 146, 30) = Left$(g_str3057, 30)
    Mid(strRecord, 146, 30) = Left$(g_str17, 30)

    Mid(strRecord, 176, 8) = Right$(g_str18, 8)
    Mid(strRecord, 184, 30) = Left$(g_str15, 30)
    Mid(strRecord, 214, 2) = Left$(g_str16, 2)
    Mid(strRecord, 216, 10) = Left$(g_str50, 10)
    Mid(strRecord, 226, 30) = Left$(g_str12, 30)
    Mid(strRecord, 256, 30) = strMiscellaneousPaymentType
    Mid(strRecord, 286, 30) = Left$(g_str29, 30)
    Mid(strRecord, 316, 10) = Right("0000000000" & CLng(CDbl(g_str1670) * 100), 10)
'        Mid(strRecord, 326, 8) = Left$(strMiscellaneousSpecialServicesFutureShipmentShipDate, 8)
    If IsDate(g_str24) Then
        Mid(strRecord, 326, 8) = Format(CDate(g_str24), "yyyymmdd")
    Else
        Mid(strRecord, 326, 8) = Format(Date, "yyyymmdd")
    End If
    Mid(strRecord, 334, 3) = Left$(g_str116, 3)

    With objFSO.OpenTextFile(mstrEXPORT_FILE_PATH & strFilename & ".FDX", ForAppending, True)
        .WriteLine strRecord
        .Close
    End With

    strRecord = ""

Release:
    m_strKeyValue = ""

    Exit Sub

Cafe_AfterShipment_Error:
    MsgBox Err.Description & " (WriteReply)", vbSystemModal



End Sub
'---------------------------------------------------------------------------------------
' Procedure : WriteReturnReply()
' DateTime  : 7/14/2005
' Purpose   : REQUIRED SUB. Called after a successful return label transaction.
'             This is called for both regular and online return labels.
'---------------------------------------------------------------------------------------
'
Public Sub WriteReturnReply()

End Sub
'---------------------------------------------------------------------------------------
' Procedure : WriteBOLReply()
' DateTime  : 1/11/2006
' Purpose   : REQUIRED SUB. Called after a successful FedEx Freight BOL transaction.
'             This is called for both regular and online return labels.
'---------------------------------------------------------------------------------------
'
Public Sub WriteBOLReply()

End Sub
'---------------------------------------------------------------------------------------
' Procedure : WriteBatchEditReply()
' DateTime  : 1/17/2006
' Purpose   : REQUIRED SUB. Called after a successful Batch Error Edit transaction.
'             This is called for both regular and online return labels.
'---------------------------------------------------------------------------------------
'
Public Sub WriteBatchEditReply()

End Sub
' Procedure : WriteTagReply()
' DateTime  : 1/26/2006
' Purpose   : REQUIRED SUB. Called after a successful Call Tag/Express Tag transaction.
'---------------------------------------------------------------------------------------
'
Public Sub WriteTagReply()

End Sub
' Procedure : WriteCancelTagReply()
' DateTime  : 1/26/2006
' Purpose   : REQUIRED SUB. Called after a successful Cancel Call Tag/Express Tag transaction.
'---------------------------------------------------------------------------------------
'
Public Sub WriteCancelTagReply()

End Sub
'---------------------------------------------------------------------------------------
' Procedure : WriteReturnDelete()
' DateTime  : 7/14/2005
' Purpose   : REQUIRED SUB. Called after a successful return label delete transaction.
'             This is called for both regular and online return labels.
'---------------------------------------------------------------------------------------
'
Public Sub WriteReturnDelete(ByVal strTracking As String)

End Sub
'---------------------------------------------------------------------------------------
' Procedure : WriteError()
' DateTime  : 7/5/2004
' Purpose   : REQUIRED SUB. Can be used as hook to call routines to be executed after
'             an FXRS Error reply transaction.
'---------------------------------------------------------------------------------------
'
Public Sub WriteError()
    MsgBox "Shipping Error: " & g_str3, vbCritical, "FSMS Error"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : WriteDelete()
' DateTime  : 7/5/2004
' Purpose   : REQUIRED SUB. Can be used as hook to call routines to be executed after
'             successful FXRS Delete.
' Called    : frmShip g_clsParser_Parsecomplete() event on FSMS 123 reply
'---------------------------------------------------------------------------------------
'
Public Sub WriteDelete(ByVal strTracking As String)

End Sub
'---------------------------------------------------------------------------------------
' Procedure : AfterClose()
' DateTime  : 7/5/2004
' Purpose   : REQUIRED SUB. Can be used as hook to call routines to be executed after
'             FXRS Close.
'---------------------------------------------------------------------------------------
'
Public Sub AfterClose()

End Sub
'

' 2007-04-13, JFW, Allow for custom screen display.
Public Sub AfterConnect()

    ' 2007-12-07, JFW, Large address book making a slow start on some clients.
    ' Call frmShip.ToggleLookup(True)
    On Error Resume Next
    'Call frmShip.ToggleDepartment(True)
    frmShip.f70.ListIndex = 0
    frmShip.f72.ListIndex = 0
    frmShip.f38 = g_clsReg.GetRegistryValue("Carry_f38", "")
    frmShip.f75 = g_clsReg.GetRegistryValue("Carry_f75", "")

End Sub
'

'---------------------------------------------------------------------------------------
' Procedure : BeforeClose()
' DateTime  : 7/12/2006
' Purpose   : REQUIRED SUB. Can be used as hook to call routines to be executed before
'             FXRS Close.
'---------------------------------------------------------------------------------------
'
Public Function BeforeClose() As Boolean

    BeforeClose = True

End Function
'

'---------------------------------------------------------------------------------------
' Procedure : BeforeShip()
' DateTime  : 2/21/2005
' Purpose   : REQUIRED Function. Modified to Return Boolean which controls whether or not
'             the shipment will continue or be canceled. Return True to continue shipment,
'             False to cancel.
'---------------------------------------------------------------------------------------
'
Public Function BeforeShip(Optional ByRef TransString As String = "") As Boolean

'    If TransString <> "" Then
'        TransactionStripTag TransString, "583"
'        TransactionBuilder TransString, "583", g_str1670
'        TransString = Replace(TransString, "99,""""", "")
'        TransactionBuilder TransString, 99, ""
'    End If

    BeforeShip = True

    If frmShip.f25 = "" Then
        MsgBox "Reference is mandatory.", vbApplicationModal + vbSystemModal
        frmShip.SSTab1.Tab = 0
        frmShip.f25.SetFocus
        BeforeShip = False
    End If

End Function
'

'---------------------------------------------------------------------------------------
' Procedure : BeforeShipTrans()
' DateTime  : 8/7/2008
' Purpose   : REQUIRED Function. Modified to Return Boolean which controls whether or not
'             the shipment will continue or be canceled. Return True to continue shipment,
'             False to cancel.
'---------------------------------------------------------------------------------------
'
Public Function BeforeShipTrans(ByRef TransString As String) As Boolean
    
    Dim lngMsgBoxResult As VbMsgBoxResult
    BeforeShipTrans = True
    
End Function
'


'---------------------------------------------------------------------------------------
' Procedure : ImportConvert
' DateTime  : 02/12/2007
' Purpose   : From FXI PA for Electrosonic.
'---------------------------------------------------------------------------------------
'
Private Function ImportConvert(ByVal strField As String, ByVal strValue As String) As Variant

    On Error GoTo ImportConvert_Error

    'Set return value of import conversion
    Select Case strField
        Case "MiscellaneousPaymentType"
            Select Case UCase(Trim(strValue))
                Case "FEDEX P1"
                    ImportConvert = 1
                Case "FEDEX COLL"
                    ImportConvert = 2
                Case "FEDEX COLLECT"
                    ImportConvert = 2
                Case Else
                    ImportConvert = 1
            End Select

      End Select

    Exit Function

ImportConvert_Error:

    MsgBox Err.Description & " (ImportConvert)"

End Function


'---------------------------------------------------------------------------------------
' Procedure : Initialize()
' DateTime  : 7/5/2004
' Purpose   : REQUIRED SUB. Can be used as hook to call routines to be executed on
'             program execution.
'---------------------------------------------------------------------------------------
'
Public Sub Initialize(Optional f1 As Form)

End Sub
'---------------------------------------------------------------------------------------
' Procedure : BeforeBatch()
' DateTime  : 20070621-01 Changed BeforeBatch to return a boolean
' Purpose   : REQUIRED SUB. Called before an entire batch is processed.
'---------------------------------------------------------------------------------------
'
Public Function BeforeBatch() As Boolean

    BeforeBatch = True

End Function
'---------------------------------------------------------------------------------------
' Procedure : BeforeBatchShip()
' DateTime  : 20070822-02 Modified BeforeBatchShip to return a Boolean.
' Purpose   : REQUIRED SUB. Called just before a batch transaction is sent to the server.
'---------------------------------------------------------------------------------------
'
Public Function BeforeBatchShip() As Boolean

    BeforeBatchShip = True

End Function
'---------------------------------------------------------------------------------------
' Procedure : AfterBatchShip()
' DateTime  : 10/28/2005
' Purpose   : REQUIRED SUB. Called just after a batch transaction has been processed.
'---------------------------------------------------------------------------------------
'
Public Sub AfterBatchShip()

End Sub
'---------------------------------------------------------------------------------------
' Procedure : AfterBatch()
' DateTime  : 4/6/2005
' Purpose   : REQUIRED SUB. Can be used as hook to call routines to be executed after
'             a batch shipment has been completed.
'---------------------------------------------------------------------------------------
'
Public Sub AfterBatch()

End Sub
'---------------------------------------------------------------------------------------
' Procedure : AfterAddrLookup()
' DateTime  : 2/21/2005
' Purpose   : REQUIRED SUB. Can be used as hook to call routines to be executed after
'             cboCustID, cboContact, or cboCompany loses focus.
'---------------------------------------------------------------------------------------
'
Public Sub AfterAddrLookup()
    frmShip.f25.SetFocus
End Sub
'---------------------------------------------------------------------------------------
' Procedure : AfterDeptLostFocus()
' DateTime  : 2/21/2005
' Purpose   : REQUIRED SUB. Can be used as hook to call routines to be executed after
'             f38 loses focus.
'---------------------------------------------------------------------------------------
'
Public Sub AfterDeptLostFocus()

    On Error Resume Next
    g_clsReg.SetRegistryValue "Carry_f38", frmShip.f38, REG_SZ

End Sub
'---------------------------------------------------------------------------------------
' Procedure : AfterAddrVerifyUpdate()
' DateTime  : 9/13/2005
' Purpose   : REQUIRED SUB. Can be used as hook to call routines to be executed after
'             an address has been updated on the Ship form.
'---------------------------------------------------------------------------------------
'
Public Sub AfterAddrVerifyUpdate()

End Sub
'---------------------------------------------------------------------------------------
' Procedure : AfterLocationChange()
' DateTime  : 3/06/2006
' Purpose   : REQUIRED SUB. Can be used as hook to call routines to be executed after
'             the shipping Location has been changed on the Ship form.
'---------------------------------------------------------------------------------------
'
Public Sub AfterLocationChange()

    mstrIntegrationStyle = g_clsSettings.Setting("IntegrationStyle" & frmShip.cboLocationName(0).Text)
    If mstrIntegrationStyle = "" Then
        g_clsSettings.Setting("IntegrationStyle" & frmShip.cboLocationName(0).Text) = "EXPRESS"
        g_clsSettings.SaveSettings
        mstrIntegrationStyle = g_clsSettings.Setting("IntegrationStyle" & frmShip.cboLocationName(0).Text)
        frmMsgBox.ShowMessage "Integration style created for location " _
            & frmShip.cboLocationName(0).Text _
            & " default to " & mstrIntegrationStyle & ".", 8000
    End If

End Sub
'

'---------------------------------------------------------------------------------------
' Procedure : AfterAddrVerify()
' DateTime  : 5/12/2006
' Purpose   : REQUIRED SUB. Can be used as hook to call routines to be executed after
'             Address Verification. Three possible status codes are passed. See comments
'             below.
'---------------------------------------------------------------------------------------
'
Public Sub AfterAddrVerify(ByVal intStatusCode As Integer)

    Select Case intStatusCode
        'Address is verfified
        Case 1

        'Soft error
        Case 2

        'Hard error
        Case 3

    End Select

End Sub
'---------------------------------------------------------------------------------------
' Procedure : BuildCustomSPLabel()
' DateTime  : 20070620-04
' Purpose   : REQUIRED SUB. Can be used as hook to create custom EPL or ZPL buffer labels
'             for SmartPost.
'---------------------------------------------------------------------------------------
'
Public Function BuildCustomSPLabel(ByVal strLabel As String) As String

    BuildCustomSPLabel = strLabel

End Function
'


'---------------------------------------------------------------------------------------
' Procedure : AfterLostFocus()
' DateTime  : 2/21/2005
' Purpose   : REQUIRED SUB. Can be used as hook to call routines to be executed after
'             cboDept or f38 loses focus.
'---------------------------------------------------------------------------------------
'
Public Sub AfterLostFocus(c1 As Control)

    If c1.name = "f38" Then
        'g_clsReg.SetRegistryValue "Carry_f38", frmShip.f38, REG_SZ
    End If
    If c1.name = "f1273" Then
        'g_clsReg.SetRegistryValue "Carry_f1273", Left(frmShip.f1273.Text, 2), REG_SZ
    End If
    
End Sub
'

'---------------------------------------------------------------------------------------
' Procedure : AfterRateQuote()
' DateTime  : 20071106-01
' Purpose   : REQUIRED SUB. Can be used as hook to call routines to be executed after
'             a rate quote.
'---------------------------------------------------------------------------------------
'
Public Sub AfterRateQuote()

End Sub

#End If

